package com.up.upzl.biz.service;

import com.up.upzl.base.service.BaseService;
import com.up.upzl.biz.domain.Shop;
import com.up.upzl.biz.domain.Shop.CreateType;
import com.up.upzl.biz.domain.Shop.ShopAudit;
import com.up.upzl.biz.domain.Shop.ShopFlow;
import com.up.upzl.biz.domain.Shop.Type;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

/**
 * 商铺管理
 * 
 * @author joker
 *
 */
public interface ShopService extends BaseService<Shop, Long> {

	 void notifySucc(String siteCode, Long id);
	
	 List<Shop> fetchByCondition(String siteCode, Long[] ids, String source, String areatext, Shop.Type shopType,
			   String manageBusinessType, String name, Date beginTime, Date endTime);
	//通过API查询
	 Page<Shop> list(Boolean status, String siteCode, String source, String areaText, Type shopType,
			   String manageBusinessType, String name, Date beginTime, Date endTime, Pageable page);
	
	Page<Shop> findByCondition(CreateType createType, Long city, Long area, Long businessArea, Integer rentType,
			Type type, Long parentManageType, Long sonManageType, Integer onlineStatus, String name, String shopNumber, ShopAudit shopAudit, Date beginTime,
			Date endTime, Pageable page);
	
	/**
	 * 核铺列表查询
	 *
	 */
	Page<Shop> findByAuditCondition(CreateType createType, Long city, Long area, Long businessArea, Integer rentType,
			Type type, Long shopBusinessType, String name, String shopNumber, Date beginTime,
			Date endTime, Date claimBeginTime, Date claimEndTime, Date verifyBeginTime, Date verifyEndTime, 
			Date auditBeginTime, Date auditEndTime, ShopAudit shopAudit, String verifyName, Pageable page,String sysAccount);
	
	/**
	 * 核铺待认领列表查询
	 *
	 */
	Page<Shop> findByAuditConditions(CreateType createType, Long city, Long area, Long businessArea, Integer rentType,
			Type type, Long shopBusinessType, String name, String shopNumber, Date beginTime,
			Date endTime, Date claimBeginTime, Date claimEndTime, Date verifyBeginTime, Date verifyEndTime, 
			Date auditBeginTime, Date auditEndTime, ShopFlow shopFlow, String verifyName, Pageable page,String sysAccount);

	List<Shop> findAllX(CreateType createType, Long city, Long area, Long businessArea, Integer rentType, Type type,
			Long parentManageType, Long sonManageType, Integer onlineStatus, String name, String shopNumber, Date beginTime, Date endTime);
	
	/**
	 *根据账号和时间判断每人每天认领了多少条信息
	 *
	 */
	List<Shop> findByUserAccount(Long sid, Date nowTime);
	
	/**
	 *  核铺一级更新
	 * @param id 商铺标识
	 * @param shopAudit 一级核铺状态
	 * @param remark 拒绝原因
	 * @return 影响行数
	 */
	Integer updateShopAudit(Long id,String shopAudit,String remark);

	
	List<Shop> shopIds(String site, String ids);
	
	/**
	 * 根据手机号查询
	 * @param phone
	 * @return
	 */
	Shop findByPhone(String phone);
	
	
	List<Shop> findByAppShop(Long next, Pageable pageable);

}
